package cn.sail.spring.mvc.util;

import cn.sail.spring.mvc.content.Content;

import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class StringUtil {
    public static String getUploadDateDir() {
        Calendar calendar = Calendar.getInstance();
        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH);
        int day = calendar.get(Calendar.DATE);
        String dirPath =  year + File.separator + month + File.separator + day + File.separator;
        return dirPath;
        }

    public static String getTimeStampString(){
        DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
        Calendar calendar = Calendar.getInstance();
        String dateName = df.format(calendar.getTime());
        return dateName;
    }
    }
